<script>
import { cloudId } from "./config"

export default {
  onLaunch: async function () {
    //#ifdef MP-QQ
    require("./plugin/sdk-qq.3.15.0.js")
    qq.BaaS.init(cloudId)
    //#endif

    //#ifdef MP-WEIXIN
    wx.BaaS = requirePlugin("sdkPlugin")
    wx.BaaS.wxExtend(wx.login, wx.getUserInfo, wx.requestPayment)
    wx.BaaS.init(cloudId)
    //#endif

    uni.loadFontFace({
      family: "score",
      source:
        'url("https://656e-env-used-1258356576.tcb.qcloud.la/v2/font/webfont.ttf?sign=e628e7db7f40bb2193e0bd51adaeb106&t=1603866825")',
    })
    await this.$store.dispatch("user/getUserInfo")
  },

  onShow: function (options) {
    //#ifdef MP-WEIXIN
    wx.BaaS.reportTemplateMsgAnalytics(options)
    //#endif
    //#ifdef MP-QQ
    qq.BaaS.reportTemplateMsgAnalytics(options)
    //#endif
  },

  onHide: function () {},
}
</script>

<style lang="scss">
@import "uni.scss";
@import "uview-ui/index.scss";
@import "static/styles/index.scss";

page {
  background: #ecf0f3;
}
</style>
